package action.method;

import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.el.ValueExpression;

import javax.faces.application.Application;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;

import oracle.adf.model.BindingContext;
import oracle.adf.model.OperationBinding;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;

import action.next_action_1;

import oracle.jbo.Row;

public class next_method_1 {
    public next_method_1() {
    }

    public void next_method1(ActionEvent actionEvent) {
      FacesContext facesCtx = FacesContext.getCurrentInstance();                  
      Application app = facesCtx.getApplication();  
      ExpressionFactory elFactory = app.getExpressionFactory();  
      ELContext elContext = facesCtx.getELContext();  
      ValueExpression valueExp = elFactory.createValueExpression(elContext, "#{next_1}", Object.class); 
      next_action_1 preguntas=(next_action_1)valueExp.getValue(elContext);
             
      BindingContext btx = BindingContext.getCurrent();
      DCBindingContainer dcbct = (DCBindingContainer)btx.getCurrentBindingsEntry();
      DCIteratorBinding binding = dcbct.findIteratorBinding("preguntaVO1Iterator");
      Row currentRow = binding.getCurrentRow();  
      
      preguntas.setPregunta11(currentRow.getAttribute(0).toString());
      
      OperationBinding opb = (OperationBinding)dcbct.getOperationBinding("Next");
      opb.execute();
      currentRow = binding.getCurrentRow();  
      preguntas.setPregunta12(currentRow.getAttribute(0).toString());
      
      opb = (OperationBinding)dcbct.getOperationBinding("Next");
      opb.execute();
      currentRow = binding.getCurrentRow();  
      preguntas.setPregunta13(currentRow.getAttribute(0).toString());
        
      opb = (OperationBinding)dcbct.getOperationBinding("Next");
      opb.execute();
      currentRow = binding.getCurrentRow();  
      preguntas.setPregunta14(currentRow.getAttribute(0).toString());
//**************************************************************************************           
      DCIteratorBinding binding2 = dcbct.findIteratorBinding("pregunta2VO1Iterator");
      Row currentRow2 = binding2.getCurrentRow();  
      
      preguntas.setPregunta21(currentRow2.getAttribute(0).toString());
      
      OperationBinding opb2 = (OperationBinding)dcbct.getOperationBinding("Next1");
      opb2.execute();
      currentRow2 = binding2.getCurrentRow();  
      preguntas.setPregunta22(currentRow2.getAttribute(0).toString());
      
      opb2 = (OperationBinding)dcbct.getOperationBinding("Next1");
      opb2.execute();
      currentRow2 = binding2.getCurrentRow();  
      preguntas.setPregunta23(currentRow2.getAttribute(0).toString());
        
      opb2 = (OperationBinding)dcbct.getOperationBinding("Next1");
      opb2.execute();
      currentRow2 = binding2.getCurrentRow();  
      preguntas.setPregunta24(currentRow2.getAttribute(0).toString());            
      //**************************************************************************************           
            DCIteratorBinding binding3 = dcbct.findIteratorBinding("pregunta3VO1Iterator");
            Row currentRow3 = binding3.getCurrentRow();  
            
            preguntas.setPregunta31(currentRow3.getAttribute(0).toString());
            
            OperationBinding opb3 = (OperationBinding)dcbct.getOperationBinding("Next2");
            opb3.execute();
            currentRow3 = binding3.getCurrentRow();  
            preguntas.setPregunta32(currentRow3.getAttribute(0).toString());
            
            opb3 = (OperationBinding)dcbct.getOperationBinding("Next2");
            opb3.execute();
            currentRow3 = binding3.getCurrentRow();  
            preguntas.setPregunta33(currentRow3.getAttribute(0).toString());
              
            opb3 = (OperationBinding)dcbct.getOperationBinding("Next2");
            opb3.execute();
            currentRow3 = binding3.getCurrentRow();  
            preguntas.setPregunta34(currentRow3.getAttribute(0).toString());         
      //**************************************************************************************           
            DCIteratorBinding binding4 = dcbct.findIteratorBinding("pregunta4VO1Iterator");
            Row currentRow4 = binding4.getCurrentRow();  
            
            preguntas.setPregunta41(currentRow4.getAttribute(0).toString());
            
            OperationBinding opb4 = (OperationBinding)dcbct.getOperationBinding("Next3");
            opb4.execute();
            currentRow4 = binding4.getCurrentRow();  
            preguntas.setPregunta42(currentRow4.getAttribute(0).toString());
            
            opb4 = (OperationBinding)dcbct.getOperationBinding("Next3");
            opb4.execute();
            currentRow4 = binding4.getCurrentRow();  
            preguntas.setPregunta43(currentRow4.getAttribute(0).toString());
              
            opb4 = (OperationBinding)dcbct.getOperationBinding("Next3");
            opb4.execute();
            currentRow4 = binding4.getCurrentRow();  
            preguntas.setPregunta44(currentRow4.getAttribute(0).toString());                     
    }
}
